package cn.demoncat.util.mysql.entity;

import cn.demoncat.util.lang.StringUtil;
import cn.demoncat.util.lang.constant.StatusConstant;

/**
 * 描述：代码生成-DB字段
 *
 * @author yxl
 *
 * @version 2.0
 *
 * @since 2016年7月9日
 */
public class DbGenField {

	// 字段名
	private String name;
	// 字段POJO属性名
	private String javaName;
	// 字段POJO属性大名
	private String javaBigName;
	// 字段注释
	private String comment;
	// 字段类型
	private String type;
	// 字段JDBC类型
	private String jdbcType;
	// 是否为日期类型
	private String isDateType = StatusConstant.Common.NO;

	public DbGenField() {
		super();
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
		if (name.endsWith("date") || name.endsWith("time")) {
			this.isDateType = StatusConstant.Common.YES;
		}
	}

	public String getComment() {
		return comment;
	}

	public void setComment(String comment) {
		this.comment = comment;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
		if (type.equals("datetime") || type.equals("date") || type.equals("time")) {
			this.isDateType = StatusConstant.Common.YES;
		}
	}

	public String getJavaName() {
		return javaName;
	}

	public void setJavaName(String javaName) {
		this.javaName = javaName;
		this.javaBigName = StringUtil.firstUpper(javaName);
	}

	public String getJavaBigName() {
		return javaBigName;
	}

	public void setJavaBigName(String javaBigName) {
		this.javaBigName = javaBigName;
	}

	public String getJdbcType() {
		return jdbcType;
	}

	public void setJdbcType(String jdbcType) {
		this.jdbcType = jdbcType;
	}

	public String getIsDateType() {
		return isDateType;
	}

	public void setIsDate(String isDateType) {
		this.isDateType = isDateType;
	}
}
